-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*: separate auto_increment ID allocator from _tidb_rowid allocator #20708
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
/run-all-test |
@tangenta: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/hold because the need to design a complete test |
The new implementation is #28448. |
What problem does this PR solve?
Issue Number: close #982
Problem Summary: before this PR, auto_increment ID and
_tidb_rowid
share the same key-value. The problem is any action that affectsauto_increment
column also has an impact on_tidb_rowid
. For example,The first insert statement forces auto_increment ID rebase to
9223372036854775807
. Even if the second insert statement does not trigger auto_increment ID allocation, TiDB throws an "Failed to read" error because the_tidb_rowid
allocator is exhausted.What is changed and how it works?
What's Changed:
TiDB behavior changes:
ALTER TABLE ... AUTO_INCREMENT = ?
will not affect_tidb_rowid
allocation anymore.@@auto_increment_increment
and@@auto_increment_offset
will not affect_tidb_rowid
allocation anymore.AUTO_ID_CACHE
keeps unchanged(AUTO_ID_CACHE
still affects_tidb_rowid
allocation).Related changes
pingcap/docs
/pingcap/docs-cn
:Check List
Tests
Side effects
Release note